# -*- coding: utf-8 -*-
from django.contrib import admin
from blog.models import Post, Page

class PostAdmin(admin.ModelAdmin):
	date_hierarchy = 'pub_date'
	prepopulated_fields = {'slug': ('title',)}
	search_fields = ['title', 'sidebar', 'text']

	class Media:
		js = ('/static/js/tiny_mce/tiny_mce.js', '/static/js/tiny-mce-config.js',)

class PageAdmin(admin.ModelAdmin):
	prepopulated_fields = {'slug': ('title',)}
	search_fields = ['title', 'sidebar', 'text']

	class Media:
		js = ('/static/js/tiny_mce/tiny_mce.js', '/static/js/tiny-mce-config.js',)

admin.site.register(Post, PostAdmin)
admin.site.register(Page, PageAdmin)
